package Xiaofang;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;

public class Work06 {
    public static void main(String[] args) {
        File file=new File("D:\\Xiaofang\\chaoxian.txt");
        try {
            RandomAccessFile ra=new RandomAccessFile(file,"r");
            try {
                ra.seek(10);
                byte[] b=new byte[1024];
                int h;
                while ((h=ra.read(b))>0){
                    System.out.println(new String(b,0,h));
                }
            } catch (IOException e) {
                e.printStackTrace();
            }finally {
                try {
                    ra.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
    }
}
